
package com.work.db.entity;

import java.io.Serializable;
import java.util.*;

import javax.persistence.*;

@Entity
@Table(name = "EMPLOYMENT")
public class Employment extends BaseEntity implements Serializable {

	private static final long serialVersionUID = 4782873809718462907L;

	@Column(name = "DATE_FROM", nullable = false)
	private Date dateFrom;

	@Column(name = "DATE_TO", nullable = true)
	private Date dateTo;

	@Column(name = "DESCRIPTION", columnDefinition = "VARCHAR(500)", nullable = true)
	private String description;

	@Column(name = "CURRENT")
	private boolean current;

	@ManyToOne(optional = false, cascade = CascadeType.ALL)
	private Employer employer;

	@ManyToOne(optional = false, cascade = CascadeType.ALL)
	private User employee;

	public Employment() {
		super();
	}

	public Date getDateFrom()
	{
		return dateFrom;
	}

	public void setDateFrom(Date dateFrom)
	{
		this.dateFrom = dateFrom;
	}

	public Date getDateTo()
	{
		return dateTo;
	}

	public void setDateTo(Date dateTo)
	{
		this.dateTo = dateTo;
	}

	public String getDescription()
	{
		return description;
	}

	public void setDescription(String description)
	{
		this.description = description;
	}

	public Employer getEmployer()
	{
		return employer;
	}

	public void setEmployer(Employer employer)
	{
		this.employer = employer;
	}

	public User getEmployee()
	{
		return employee;
	}

	public void setEmployee(User employee)
	{
		this.employee = employee;
	}

	public boolean isCurrent()
	{
		return current;
	}

	public void setCurrent(boolean current)
	{
		this.current = current;
	}

}
